/*
 * Copyright (c) 2017 22420103@QQ.COM 版权所有
 */
package com.lehe.config;

import org.sitemesh.builder.SiteMeshFilterBuilder;
import org.sitemesh.config.ConfigurableSiteMeshFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class SitemeshConfig {
	@Bean
	public FilterRegistrationBean siteMeshFilter(){
		FilterRegistrationBean filter = new FilterRegistrationBean();
		filter.setFilter(new ConfigurableSiteMeshFilter(){
			@Override
			protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
				
				builder.addDecoratorPath("/admin","/WEB-INF/layout/default.jsp");
				builder.addDecoratorPath("/admin/*","/WEB-INF/layout/default.jsp");
			}
		});
		return filter;
	}
}
